package com.zsj.mysql.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zsj.entity.StatisticRechargeBean;
import com.zsj.mysql.entity.DyMobileRecharge;
import com.zsj.mysql.entity.RechargeStatics;
import com.zsj.mysql.mapper.DyMobileRechargeMapper;
import com.zsj.mysql.service.IDyMobileRechargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * <p>
 * 字节手机充值表 服务实现类
 * </p>
 *
 * @author
 * @since
 */
@Service
public class DyMobileRechargeServiceImpl extends ServiceImpl<DyMobileRechargeMapper,
        DyMobileRecharge> implements IDyMobileRechargeService {

    @Autowired
    private DyMobileRechargeMapper mapper;

    @Override
    public List<DyMobileRecharge> getFinishByDayAndAppId(String month, Integer day, String appId) {
        return mapper.getFinishByDayAndAppId(month, day, appId);
    }

    @Override
    public DyMobileRecharge getByOrderNo(String month, String orderNo) {
        return mapper.getByOrderNo(month, orderNo);
    }

    @Override
    public DyMobileRecharge getBySelfOrderNo(String month, String orderNo) {
        return mapper.getBySelfOrderNo(month, orderNo);
    }

    @Override
    public boolean updateFinal(String month, DyMobileRecharge entity) {
        return mapper.updateFinal(month, entity) > 0;
    }

    @Override
    public boolean updateNotify(String month, Integer notifyStatus, String lastNotifyTime, String chargeNo) {
        return mapper.updateNotify(month, notifyStatus, lastNotifyTime, chargeNo) > 0;
    }

    @Override
    public List<DyMobileRecharge> getNeedNotify(String month, String lastTime, Integer notifyTimes) {
        return mapper.getNeedNotify(month, lastTime, notifyTimes);
    }

    @Override
    public List<StatisticRechargeBean> getSuccStatistic(String month, String txnDate, String appId) {
        return mapper.getSuccStatistic(month, txnDate, appId);
    }

    @Override
    public List<StatisticRechargeBean> getTotalStatistic(String month, String txnDate, String appId) {
        return mapper.getTotalStatistic(month, txnDate, appId);
    }

    @Override
    public List<StatisticRechargeBean> getRateStatistic(String month, String txnDate, Integer time, String appId) {
        return mapper.getRateStatistic(month, txnDate, time, appId);
    }

    @Override
    public boolean  updateReorder(String month, Integer reorderStatus, String lastReorderTime, String chargeNo) {
        return mapper.updateReorder(month, reorderStatus, lastReorderTime, chargeNo) > 0;
    }

    @Override
    public List<DyMobileRecharge> getNeedReorder4Job(String month, String txnDate, Integer reorderTimes,  String startTime, String endTime, Integer count) {
        return mapper.getNeedReorderByStatus(month, txnDate, reorderTimes, startTime, endTime, count);
    }

    @Override
    public List<RechargeStatics> getAmtStatistic(String month, String finishDate) {
        return mapper.getAmtStatistic(month, finishDate);
    }
}
